<?php
include LIB_PATH . 'Action/YAction.class.php';
class SearchAction extends YAction {
	public function __construct() {
		parent::__construct();
	}
	
	public function index() {
		$k = y_getParam('k', 'get');
		$data = array();
		$pageString = '';
		$this->assign('k', $k);
		
		if(!empty($k)) {
			$data = D('Search')->searchByKey($k);
			$pageString = $data['pageString'];
			unset($data['pageString']);
		}
		
		$this->assign('pageString', $pageString);
		$this->assign('data', $data);
		
		$this->display();
	}
}